package com.rj.core.validation.constraints;

import com.rj.core.validation.InValidator;
import jakarta.validation.Constraint;
import jakarta.validation.Payload;


import java.lang.annotation.*;

/***
 * 在选择
 * @author YFX_RANLUBO
 * @date 2022/10/25 18:00
 */
@Target({ElementType.METHOD, ElementType.FIELD, ElementType.ANNOTATION_TYPE, ElementType.CONSTRUCTOR, ElementType.PARAMETER, ElementType.TYPE_USE})
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Constraint(
        validatedBy = {InValidator.class}
)
public @interface In {
    String message() default "{label}只能为{value}";

    Class<?>[] groups() default {};

    Class<? extends Payload>[] payload() default {};

    String[] value();

    /**
     * 标签名
     */
    String label();
}